home *** CD-ROM | disk | FTP | other *** search
/ Professional Soft Collection 1.02 / Professional Soft Collection 1.02.iso / win32s / disk1 / 32sinst.mst < prev    next >
Text File  |  1995-08-31  |  16KB  |  510 lines

  1.  
  2. '**************************************************************************
  3. '*                  MS Test script for Win32s setup program
  4. '**************************************************************************
  5.  
  6. ''$DEFINE DEBUG  ''Define for script development/debugging
  7.  
  8. '$INCLUDE 'setupapi.inc'
  9. '$INCLUDE 'msdetect.inc'
  10.  
  11. ''Dialog ID's
  12. CONST WELCOME                  = 100
  13. CONST ASKQUIT                  = 200
  14. CONST DESTPATH                 = 300
  15. CONST EXITFAILURE              = 400
  16. CONST EXITQUIT                 = 600
  17. CONST EXITSUCCESS              = 700
  18. CONST OPTIONS                  = 800
  19. CONST BADPATH                  = 6400
  20.  
  21. CONST HELPWELCOME              = 1000
  22. CONST VERPATH                  = 1100
  23. CONST EXITFAILNOTWIN31         = 1200
  24. CONST EXITFAILNOTENH           = 1300
  25. CONST EXITFAILNOTPAGING        = 1325
  26. CONST EXITFAILNOTINTEL         = 1350
  27. CONST FREECELLINST             = 1400
  28. CONST FREECELLINSTNOWIN32S     = 1450
  29. CONST FREECELLPATH             = 1500
  30. CONST HELPFREECELL             = 1600
  31.  
  32.  
  33. ''Bitmap ID
  34. CONST LOGO = 1
  35.  
  36. ''String ID's
  37. CONST VIRTUAL_BODY             = 2
  38. CONST VIRTUAL_TITLE            = 3
  39. CONST SHARE_BODY               = 4
  40. CONST SHARE_TITLE              = 5
  41. CONST SUCCESS_BODY             = 6
  42. CONST SUCCESS_TITLE            = 7
  43. CONST FREECELL_BODY            = 8
  44. CONST FREECELL_TITLE           = 9
  45. CONST RESTART_BODY             = 10
  46. CONST RESTART_TITLE            = 11
  47. CONST CORRUPT_BODY             = 12
  48. CONST CORRUPT_TITLE            = 13
  49.  
  50. GLOBAL DESTSYS$      ''Windows\System directory.
  51. GLOBAL DEST32S$      ''Windows\System\Win32s directory
  52. GLOBAL DESTFREE$     ''Freecell directory
  53.  
  54. DECLARE SUB Install(OLEONLY%)
  55. DECLARE SUB UpdateSystemIni
  56. DECLARE SUB RebootSystem
  57. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  58. DECLARE FUNCTION MakeSystemIni LIB "INIUPD.DLL" (arg1$, arg2$) AS INTEGER
  59. DECLARE FUNCTION RestartWindows LIB "INIUPD.DLL" AS INTEGER
  60. DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
  61. DECLARE FUNCTION PagingEnabled LIB "INIUPD.DLL" AS INTEGER
  62. DECLARE FUNCTION ShareEnabled LIB "INIUPD.DLL" AS INTEGER
  63. DECLARE FUNCTION IsWin32sLoaded LIB "INIUPD.DLL" (arg1$) AS INTEGER
  64. DECLARE FUNCTION FSetOleOnlyFlag LIB "MSCUISTF.DLL" (arg1%) AS INTEGER
  65. DECLARE FUNCTION ExitWindowsExec LIB "USER.EXE" (arg1$, arg2$) AS INTEGER
  66. DECLARE FUNCTION DoGlobMsgBox  LIB "MSCUISTF.DLL" (arg1%, arg2%, arg3%) AS INTEGER
  67.  
  68. INIT:
  69.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  70.     HELPPROC$ = "FHelpDlgProc"      ''Help dialog procedure
  71.     szOldVer$ ="1.00.000     "      ''Reserve space in string for version
  72.     WIN32ENABLED% = 0
  73.     OLEONLY% = 0
  74.  
  75.     ON ERROR GOTO ERRNORMAL
  76.  
  77.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  78.  
  79.     SetBitmap CUIDLL$, LOGO
  80.     SetTitle "Microsoft Win32s Setup Program"
  81.  
  82.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  83.     IF szInf$ = "" THEN
  84.         szInf$ = GetSymbolValue("STF_CWDDIR") + "32sinst.inf"
  85.     END IF
  86.     ReadInfFile szInf$
  87.  
  88.     DESTSYS$ = GetWindowsSysDir()
  89.     DEST32S$ = DESTSYS + "WIN32S\"
  90.  
  91. '$IFDEF DEBUG
  92.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  93.     WinDrive$ = MID$(GetWindowsDir, 1, 1)
  94.     IF IsDriveValid(WinDrive$) = 0 THEN
  95.         i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  96.         GOTO QUIT
  97.     END IF
  98. '$ENDIF ''DEBUG
  99.  
  100. CHECK:
  101.     IF GetWindowsMajorVersion < 3 THEN
  102.         ExitCode% = EXITFAILNOTWIN31
  103.         GOTO QUIT
  104.     END IF
  105.     IF GetWindowsMajorVersion = 3 AND GetWindowsMinorVersion < 1 THEN
  106.         ExitCode% = EXITFAILNOTWIN31
  107.         GOTO QUIT
  108.     END IF
  109.     IF GetWindowsMajorVersion >= 4 THEN
  110.         ExitCode% = EXITSUCCESS
  111.         WIN32ENABLED% = 1
  112.         GOTO FREECELL
  113.     END IF
  114.     IF GetWindowsMode < 2  THEN
  115.         IF OnWindowsNT() THEN
  116.             ExitCode% = EXITFAILNOTINTEL '' Running on Windows NT (on RISC)
  117.         ELSE
  118.             ExitCode% = EXITFAILNOTENH   '' Standard Mode Windows
  119.         END IF
  120.         GOTO QUIT
  121.     END IF
  122.     IF OnWindowsNT() THEN
  123.         ExitCode% = EXITSUCCESS
  124.         WIN32ENABLED% = 1
  125.         GOTO FREECELL
  126.     END IF
  127.     ExitCode% = EXITSUCCESS
  128.  
  129.     '' Get version of Win32s to be installed from version info in file
  130.     szNewVer$ = GetVersionOfFile( GetSymbolValue("STF_SRCDIR") + "WIN32S16.DLL" )
  131.     szOleNewVer$ = GetVersionOfFile( GetSymbolValue("STF_SRCDIR") + "OLE2THK.DLL" )
  132.     szOleOldVer$ = GetVersionOfFile( DESTSYS$ + "WIN32S\OLE2THK.DLL" )
  133.  
  134.     '' Check if Win32s is partially installed
  135.     sz$ = GetIniKeyString (DESTSYS$ + "WIN32S.INI", "Win32s", "Setup")
  136.     '' If WIN32S.INI specifies Win32s Setup=0, then force complete Win32s file overwrite
  137.     IF sz$ = "0" THEN
  138.         GOTO WELCOME
  139.     END IF
  140.     '' If WIN32S.INI is missing, try and reinstall Win32s files/recreate WIN32S.INI
  141.     IF sz$ <> "1" THEN
  142.         GOTO WELCOME
  143.     END IF
  144.  
  145.     '' If Win32s is already installed, get running version number
  146.     i% = DoesFileExist( DESTSYS$ + "W32SYS.DLL", femExists )
  147.     IF i% = 1 THEN
  148.         i% = IsWin32sLoaded( szOldVer$ )
  149.     ENDIF
  150.  
  151.     IF i% = 0 THEN
  152.         GOTO WELCOME
  153.     END IF
  154.  
  155.     IF szNewVer$ > szOldVer$ THEN
  156.         GOTO WELCOME
  157.     END IF
  158.  
  159.     IF (szNewVer$ = szOldVer$) THEN
  160.         '' Compare OLE32 version and versions of each of OLE16 libraries.
  161.         sz$ = GetIniKeyString (DESTSYS$ + "WIN32S.INI", "OLE2", "Setup")
  162.         '' If WIN32S.INI specifies OLE2 Setup=0, then force OLE2 file overwrite
  163.         IF ((sz$ <> "1") OR (szOleNewVer$ > szOleOldVer$)) THEN
  164.             OLEONLY% = 1
  165.             GOTO WELCOME
  166.         END IF
  167.  
  168.         szOle16NewVer$ = GetVersionOfFile( GetSymbolValue("STF_SRCDIR") + "COMPOBJ.DLL" )
  169.         szOle16OldVer$ = GetVersionOfFile( DESTSYS$ + "COMPOBJ.DLL" )
  170.         IF (szOle16NewVer$ > szOle16OldVer$) THEN
  171.             OLEONLY% = 1
  172.             GOTO WELCOME
  173.         END IF
  174.  
  175.         szOle16NewVer$ = GetVersionOfFile( GetSymbolValue("STF_SRCDIR") + "OLE2.DLL" )
  176.         szOle16OldVer$ = GetVersionOfFile( DESTSYS$ + "OLE2.DLL" )
  177.         IF (szOle16NewVer$ > szOle16OldVer$) THEN
  178.             OLEONLY% = 1
  179.             GOTO WELCOME
  180.         END IF
  181.  
  182.         szOle16NewVer$ = GetVersionOfFile( GetSymbolValue("STF_SRCDIR") + "OLE2PROX.DLL" )
  183.         szOle16OldVer$ = GetVersionOfFile( DESTSYS$ + "OLE2PROX.DLL" )
  184.         IF (szOle16NewVer$ > szOle16OldVer$) THEN
  185.             OLEONLY% = 1
  186.             GOTO WELCOME
  187.         END IF
  188.  
  189.         szOle16NewVer$ = GetVersionOfFile( GetSymbolValue("STF_SRCDIR") + "STORAGE.DLL" )
  190.         szOle16OldVer$ = GetVersionOfFile( DESTSYS$ + "STORAGE.DLL" )
  191.         IF (szOle16NewVer$ > szOle16OldVer$) THEN
  192.             OLEONLY% = 1
  193.             GOTO WELCOME
  194.         END IF
  195.  
  196.     END IF
  197.     WIN32ENABLED% = 1
  198.     GOTO FREECELL
  199.  
  200. WELCOME:
  201.     i% = FSetOleOnlyFlag(OLEONLY%)
  202.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", HELPWELCOME, HELPPROC$)
  203.     IF sz$ = "CONTINUE" THEN
  204.         UIPop 1
  205.     ELSE
  206.         GOSUB ASKQUIT
  207.         GOTO WELCOME
  208.     END IF
  209.  
  210.  
  211. GETWIN32SPATH:
  212.     IF PagingEnabled() = 0 THEN
  213.         i% = DoGlobMsgBox(VIRTUAL_BODY, VIRTUAL_TITLE, MB_TASKMODAL+MB_ICONHAND+MB_OK)
  214.         ExitCode% = EXITFAILURE '' Enhanced mode but not paging
  215.         GOTO QUIT
  216.     END IF
  217.  
  218.     IF ShareEnabled() = 0 THEN
  219.         i% = DoGlobMsgBox(SHARE_BODY, SHARE_TITLE, MB_TASKMODAL+MB_ICONEXCLAMATION+MB_OK)
  220.     END IF
  221.  
  222.     SetSymbolValue "EditTextIn", DESTSYS$
  223.     SetSymbolValue "EditFocus", "END"
  224.  
  225. GETPATHL1:
  226.     sz$ = UIStartDlg(CUIDLL$, VERPATH, "FDispDlgProc", HELPWELCOME, HELPPROC$)
  227.  
  228.     IF sz$ = "CONTINUE" THEN
  229.         IF IsDirWritable(DESTSYS$) = 0 THEN
  230.             GOSUB BADPATH
  231.             GOTO GETPATHL1
  232.         END IF
  233.         UIPop 1
  234.     ELSEIF sz$ = "REACTIVATE" THEN
  235.         GOTO GETPATHL1
  236.     ELSEIF sz$ = "BACK" THEN
  237.         UIPop 1
  238.         GOTO WELCOME
  239.     ELSE
  240.         GOSUB ASKQUIT
  241.         GOTO GETPATHL1
  242.     END IF
  243.  
  244. COPYFILES:
  245.     IF OLEONLY% = 0 THEN
  246.         CreateIniKeyValue DESTSYS$ + "WIN32S.INI", "Win32s", "Setup", "0", cmoOverwrite
  247.     END IF
  248.     IF szOleNewVer$ <> "" THEN
  249.         CreateIniKeyValue DESTSYS$ + "WIN32S.INI", "OLE2", "Setup", "0", cmoOverwrite
  250.     END IF
  251.  
  252.     '' Indicate Win32s install failure until all files known to be copied.
  253.     ExitCode% = EXITFAILURE
  254.     ERR = 0
  255.     CreateDir DEST32S$, cmoNone
  256.     Install(OLEONLY%)
  257.     UpdateSystemIni
  258.     '' Terminate if unhandled fatal error
  259.     IF ERR <> 0 THEN
  260.     GOTO QUIT
  261.     END IF
  262.  
  263.     IF OLEONLY% = 0 THEN
  264.         CreateIniKeyValue DESTSYS$ + "WIN32S.INI", "Win32s", "Setup", "1", cmoOverwrite
  265.         CreateIniKeyValue DESTSYS$ + "WIN32S.INI", "Win32s", "Version", szNewVer$, cmoOverwrite
  266.         CreateIniKeyValue DESTSYS$ + "WIN32S.INI", "Nls", "AnsiCP", "1252", cmoOverwrite
  267.     END IF
  268.     IF szOleNewVer$ <> "" THEN
  269.         CreateIniKeyValue DESTSYS$ + "WIN32S.INI", "OLE2", "Setup", "1", cmoOverwrite
  270.         CreateIniKeyValue DESTSYS$ + "WIN32S.INI", "OLE2", "Version", szOleNewVer, cmoOverwrite
  271.     END IF
  272.  
  273.     i% = DoGlobMsgBox(SUCCESS_BODY, SUCCESS_TITLE, MB_OK+MB_TASKMODAL)
  274.     '' Indicate Win32s correctly copied and installed.
  275.     ExitCode% = EXITSUCCESS
  276.  
  277. FREECELL:
  278.     IF OLEONLY% = 1 THEN
  279.         GOTO QUIT
  280.     ENDIF
  281.     IF WIN32ENABLED% = 1 THEN
  282.         sz$ = UIStartDlg(CUIDLL$, FREECELLINSTNOWIN32S, "FInfoDlgProc",0, "")
  283.     ELSE
  284.         sz$ = UIStartDlg(CUIDLL$, FREECELLINST, "FInfoDlgProc",0, "")
  285.     END IF
  286.     UIPop 1
  287.     IF sz$ <> "CONTINUE" THEN
  288.         GOTO QUIT
  289.     END IF
  290.  
  291. GETFREEPATH:
  292.     DESTFREE$ = MID$(DESTSYS$,1,3) + "WIN32APP\FREECELL\"
  293.     SetSymbolValue "EditTextIn", DESTFREE$
  294.     SetSymbolValue "EditFocus", "END"
  295.  
  296. GETFREEPATHL1:
  297.     sz$ = UIStartDlg(CUIDLL$, FREECELLPATH, "FEditDlgProc", HELPFREECELL, HELPPROC$)
  298.  
  299.     IF sz$ = "CONTINUE" THEN
  300.         DESTFREE$ = GetSymbolValue("EditTextOut")
  301.  
  302.         IF MID$(DESTFREE$, LEN(DESTFREE$), 1) <> "\" THEN
  303.             DESTFREE$ = DESTFREE$ + "\"
  304.         END IF
  305.         ''Validate new path.
  306.         IF IsDirWritable(DESTFREE$) = 0 THEN
  307.             GOSUB BADPATH
  308.             GOTO GETFREEPATHL1
  309.         END IF
  310.         UIPop 1
  311.  
  312.         GOTO COPYFREECELL
  313.     ELSEIF sz$ = "REACTIVATE" THEN
  314.         GOTO GETFREEPATHL1
  315.     ELSEIF sz$ = "EXIT" THEN
  316.         UIPop 1
  317.         GOTO QUIT
  318.     END IF
  319.  
  320. COPYFREECELL:
  321.     ClearCopyList
  322.     CreateDir DESTFREE$, cmoNone
  323.  
  324.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  325.  
  326.     ERR = 0
  327.     AddSectionFilesToCopyList "Win32appFreecell", SrcDir$, DESTFREE$
  328.     CopyFilesInCopyList
  329.     '' If error copying FreeCell, not a fatal error. Win32s is already installed.
  330.     IF ERR <> 0 THEN
  331.     ERR = 0
  332.     GOTO QUIT
  333.     END IF
  334.     ERR = 0
  335.  
  336.     IF DoesFileExist( DESTSYS$ + "WIN32S.INI", femExists ) THEN
  337.     CreateIniKeyValue DESTSYS$ + "WIN32S.INI", "Freecell", "Setup", "1", cmoOverwrite
  338.     CreateIniKeyValue DESTSYS$ + "WIN32S.INI", "Freecell", "Version", szNewVer$, cmoOverwrite
  339.     END IF
  340.  
  341.     ERR = 0
  342.     CreateProgmanGroup "Win32 Applications", "", cmoNone
  343.     ShowProgmanGroup   "Win32 Applications", 1, cmoNone
  344.     CreateProgmanItem  "Win32 Applications", "Freecell", DESTFREE$ + "FREECELL.EXE", "", cmoOverwrite
  345.     '' Only put up success dialog if icon added to group
  346.     IF ERR = 0 THEN
  347.     i% = DoGlobMsgBox(FREECELL_BODY, FREECELL_TITLE, MB_OK+MB_TASKMODAL)
  348.     END IF
  349.     ERR = 0
  350.  
  351. QUIT:
  352.     '' Install error handler for final message box routines
  353.     ON ERROR GOTO ERRQUIT
  354.     IF ERR = 0 THEN
  355.         dlg% = ExitCode%
  356.     ELSEIF ERR = STFQUIT THEN
  357.         dlg% = EXITQUIT
  358.         ExitCode% = EXITQUIT
  359.     ELSE
  360.         dlg% = EXITFAILURE
  361.         ExitCode% = EXITQUIT
  362.     END IF
  363.  
  364. QUITL1:
  365.     IF WIN32ENABLED% = 1 THEN
  366.     UIPop 1
  367.     END
  368.     END IF
  369.  
  370.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  371.     IF sz$ = "REACTIVATE" THEN
  372.         GOTO QUITL1
  373.     END IF
  374.     UIPop 1
  375.  
  376.     IF ExitCode% = EXITSUCCESS THEN
  377.         IF OLEONLY% = 0 THEN
  378.             RebootSystem
  379.             CreateIniKeyValue DESTSYS$ + "WIN32S.INI", "Win32s", "Setup", "0", cmoOverwrite
  380.             IF szOleNewVer$ <> "" THEN
  381.                 CreateIniKeyValue DESTSYS$ + "WIN32S.INI", "OLE2", "Setup", "0", cmoOverwrite
  382.             END IF
  383.             i% = DoGlobMsgBox(RESTART_BODY, RESTART_TITLE, MB_ICONEXCLAMATION+MB_OK+MB_TASKMODAL)
  384.         END IF
  385.     ENDIF
  386.  
  387.     END
  388.  
  389. '' Fatal error handler for error message routine
  390. ERRQUIT:
  391.     i% = DoGlobMsgBox(CORRUPT_BODY, CORRUPT_TITLE, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  392.     END
  393.  
  394. '' Bypass run-time errors. Let final dialog box display fatal error message.
  395. ERRNORMAL:
  396.     '' Check if user cancelled setup
  397.     IF ERR = STFQUIT THEN
  398.     GOTO QUIT
  399.     END IF
  400.     RESUME NEXT
  401.  
  402.  
  403. BADPATH:
  404.     sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  405.     IF sz$ = "REACTIVATE" THEN
  406.     GOTO BADPATH
  407.     END IF
  408.     UIPop 1
  409.     RETURN
  410.  
  411.   ASKQUIT:
  412.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  413.  
  414.     IF sz$ = "EXIT" THEN
  415.     UIPopAll
  416.     ERROR STFQUIT
  417.     ELSEIF sz$ = "REACTIVATE" THEN
  418.     GOTO ASKQUIT
  419.     ELSE
  420.     UIPop 1
  421.     END IF
  422.     RETURN
  423.  
  424.  
  425.  
  426. '**
  427. '** Purpose:
  428. '**     Builds the copy list and performs all installation operations.
  429. '** Arguments:
  430. '**     none.
  431. '** Returns:
  432. '**     none.
  433. '*************************************************************************
  434. SUB Install(OLEONLY%) STATIC
  435.  
  436.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  437.  
  438.     '' Use file layout sections that specify OLDER file version/time check
  439.     IF OLEONLY% = 0 THEN
  440.         AddSectionFilesToCopyList "WindowsSystem", SrcDir$, DESTSYS$
  441.         AddSectionFilesToCopyList "WindowsSystemWin32s", SrcDir$, DESTSYS$ + "WIN32S\"
  442.         '' Add obsolete files to be removed
  443.         AddSectionFilesToCopyList "Win32sSystemObsoleteFiles", SrcDir$, DESTSYS$ + "WIN32S\"
  444.     END IF
  445.  
  446.     i% = DoesFileExist( GetSymbolValue("STF_SRCDIR") + "OLE2THK.DL_", femExists )
  447.     if i% = 1 THEN
  448.         AddSectionFilesToCopyList "OleWindowsSystem", SrcDir$, DESTSYS$
  449.         AddSectionFilesToCopyList "OleWindowsSystemWin32s", SrcDir$, DESTSYS$ + "WIN32S\"
  450.     END IF
  451.  
  452.     SetRestartDir GetWindowsDir()
  453.  
  454.     CopyFilesInCopyList
  455.  
  456. END SUB
  457.  
  458. SUB UpdateSystemIni STATIC
  459.  
  460.     VxDPath$ = DEST32S$ + "W32S.386"
  461.     SystemIniPath$ = GetWindowsDir()
  462.  
  463.     t% = MakeSystemIni(SystemIniPath$, VxdPath$)
  464.  
  465. END SUB
  466.  
  467. SUB RebootSystem STATIC
  468.  
  469. '   Check if any files were locked during install.  If the RestartList
  470. '   is not empty, ExitExecRestart() will restart Windows, cleanup setup
  471. '   files, and copy over locked files before Windows restarts.
  472.     i% = RestartListEmpty()
  473.     IF i% = 0 THEN
  474. '      ExitExecRestart() only returns if applications refuse to be shutdown.
  475. '      Win32s is installed but will not operate until Windows is restarted
  476. '      and the Win32s VxD is loaded.
  477.        i% = ExitExecRestart()
  478.      ELSE
  479. '      If the RestartList list is empty, it is necessary to restart windows
  480. '      directly.  The MSSETUP program creates _MSRSTRT.EXE and _MSSETUP.BAT
  481. '      in the restart directory.  This program should be exec'd to handle
  482. '      proper MSSETUP cleanup (temp files) and restart Windows.
  483.        i% = ExitWindowsExec( GetWindowsDir() + "_MSRSTRT.EXE", "_MSSETUP.BAT" )
  484.      ENDIF
  485.  
  486. END SUB
  487.  
  488.  
  489. '**
  490. '** Purpose:
  491. '**     Appends a file name to the end of a directory path,
  492. '**     inserting a backslash character as needed.
  493. '** Arguments:
  494. '**     szDir$  - full directory path (with optional ending "\")
  495. '**     szFile$ - filename to append to directory
  496. '** Returns:
  497. '**     Resulting fully qualified path name.
  498. '*************************************************************************
  499. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  500.     IF szDir$ = "" THEN
  501.     MakePath = szFile$
  502.     ELSEIF szFile$ = "" THEN
  503.     MakePath = szDir$
  504.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  505.     MakePath = szDir$ + szFile$
  506.     ELSE
  507.     MakePath = szDir$ + "\" + szFile$
  508.     END IF
  509. END FUNCTION
  510.